include $(SUBDIR)../common_conf.mk

all: program-real

include $(SUBDIR)../common_build.mk

.PHONY: program-real

$(STATIC_LIBRARIES):
	make -C $(dir $@)

program-real:
	@for d in $(foreach l,$(STATIC_LIBRARIES),$(dir $l)); do \
		make -C $$d; \
	done
	@make $(PROGRAM)

$(PROGRAM): $(OBJ) $(STATIC_LIBRARIES)
	g++ -o $@ $(OBJ) $(STATIC_LIBRARIES) $(CXXFLAGS) $(DYNAMIC_LIBRARIES)

clean:
	rm -f *.o *.d *.pb.cc *.pb.h $(PROGRAM) $(EXTRA_CLEAN)
